<?php


namespace App\Http\Wpt\Teacher\V1_0\Controllers;


use App\Exceptions\ApiException;
use App\Logic\TeacherLogic;
use App\Models\QuestionModel;
use App\Models\TeacherModel;
use App\Utils\Singleton;
use Illuminate\Http\Request;
use Illuminate\Http\Response;



class TeacherController
{
    //登录
    public function loginAction(Request $request,Response $response) {

        return TeacherLogic::getInstance()->getTeacher($request,$response);
    }

    /*
    public function subjectAction(){
        return TeacherLogic::getInstance()->getSubject();
    }

    */
    // //显示科目
    public function getSubjectAction(Request $request){
        return TeacherLogic::getInstance()->getSubject();
    }

    public function addSubjectAction(Request $request,Response $response){
        // // $response = Response::create();
        //$response->exception = new ApiException(2, 'xxxx');
        // var_dump($request);

        TeacherLogic::getInstance()->addSubject($request, $response);
        return [];
    }

    public function getQuestionAction(Request $request,Response $response){
        return TeacherLogic::getInstance()->getQuestion($request,$response);
    }

    public function addQuestionAction(Request $request,Response $response){

        return TeacherLogic::getInstance()->addQuestion($request, $response);
    }

    public function delQuestionAction(Request $request,Response $response){
        return TeacherLogic::getInstance()->delQuestion($request,$response);
    }
    public function oneQuestionAction(Request $request,Response $response){
        return TeacherLogic::getInstance()->oneQuestion($request, $response);
    }
    public function editQuestionAction(Request $request,Response $response){
        return TeacherLogic::getInstance()->editQuestion($request,$response);
    }

    public function typeNumAction(Request $request,Response $response){
        return TeacherLogic::getInstance()->typeNum($request,$response);
    }


}